<template>
  <div :class="{'top-container': true,'online': true}">
    <i class="top"/>
    <i class="top1"/>
    <div class="box"/>
    <div :style="{ height: data + '%' }" class="box-active"/>
  </div>
</template>

<script>
export default {
  name: 'TopMenu',
  props: {
    data: {
      type: Number,
      default: function() {
        return 0
      }
    }
  },
  data() {
    return {
    }
  },
  created() {
    console.log(this.data)
  },
  methods: {
  }
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.top-container{
  overflow: hidden;
  position: relative;
  display: inline-block;
  width: 8px;
  height: 20px;
  margin: 0;
  padding: 0;
  .top{
    position: absolute;
    top: 0;
    left: 2px;
    width: 4px;
    height: 2px;
    background-color: #E72106;
  }
  .top1{
    position: absolute;
    top: 2px;
    left: 1px;
    width: 6px;
    height: 1px;
    background-color: #E72106;
  }
  .box{
    width: 100%;
    height: 16px;
    border: 1px solid #E72106;
    box-sizing: border-box;
    position: absolute;
    top: 3px;
  }
  .box-active{
    width: 100%;
    height: 16px;
    border: 1px solid #E72106;
    box-sizing: border-box;
    position: absolute;
    background-color: #E72106;
    top: 3px;
    bottom: 0px;
    transform: rotateX(180deg);
    // calc(100% - 3px)
  }
}
.online{
  .top{
    background-color: #0295FF;
  }
  .top1{
    background-color: #0295FF;
  }
  .box{
    border: 1px solid #0295FF;
  }
  .box-active{
    border: 1px solid #0295FF;
    background-color: #0295FF;
  }
}
</style>
